package com.chen.solution.springboot.thymeleaf.demo.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * <p>desc: 用户信息 Model </p>
 *
 * @author chentian
 * @date 2022/2/24
 */
@Data
public class User implements Serializable {
    private String id;
    @NotBlank(message = "用户不能为空")
    @Length(min = 5, max = 20, message = "用户名长度为5~20个字符")
    private String username;
    @Min(value = 18, message = "年龄不能小于18岁")
    @Max(value = 65, message = "年龄不能大于60岁")
    private Integer age;
    @Email(message = "请输入邮箱")
    private String email;
}
